package com.ruoyi.project.modules.parameter.mapper;

import java.util.List;

import com.ruoyi.project.modules.interfaceinfo.request.ListInterfaceFieldParamReq;
import com.ruoyi.project.modules.interfaceinfo.vo.InterfaceParam;
import com.ruoyi.project.modules.parameter.domain.InterfaceParamsFieldRelation;
import com.ruoyi.project.modules.parameter.domain.ParamTree;
import com.ruoyi.project.modules.parameter.domain.ParamsFieldRelation;
import com.ruoyi.project.modules.table.domain.FieldInfo;
import com.ruoyi.project.modules.table.domain.FieldStatus;
import com.ruoyi.project.modules.table.domain.TableInfo;
import com.ruoyi.project.modules.virtualUsageParamSource.vo.ObjectParam;
import org.apache.ibatis.annotations.Param;

/**
 * 接口下数据集及字段Mapper接口
 * 
 * @author smallrain
 * @date 2021-10-30
 */
public interface InterfaceParamsFieldRelationMapper 
{
    /**
     * 查询接口下数据集及字段
     * 
     * @param id 接口下数据集及字段主键
     * @return 接口下数据集及字段
     */
    public InterfaceParamsFieldRelation selectInterfaceParamsFieldRelationById(Long id);

    /**
     * 查询接口下数据集及字段列表
     * 
     * @param interfaceParamsFieldRelation 接口下数据集及字段
     * @return 接口下数据集及字段集合
     */
    public List<InterfaceParamsFieldRelation> selectInterfaceParamsFieldRelationList(InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    /**
     * 新增接口下数据集及字段
     * 
     * @param interfaceParamsFieldRelation 接口下数据集及字段
     * @return 结果
     */
    public int insertInterfaceParamsFieldRelation(InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    /**
     * 修改接口下数据集及字段
     * 
     * @param interfaceParamsFieldRelation 接口下数据集及字段
     * @return 结果
     */
    public int updateInterfaceParamsFieldRelation(InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    /**
     * 删除接口下数据集及字段
     * 
     * @param id 接口下数据集及字段主键
     * @return 结果
     */
    public int deleteInterfaceParamsFieldRelationById(Long id);

    /**
     * 批量删除接口下数据集及字段
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteInterfaceParamsFieldRelationByIds(String[] ids);

    List<ParamTree> listFieldParam(@Param("interfaceType") String interfaceType,
                                   @Param("interfaceId") Long interfaceId,
                                   @Param("paramType") String paramType);

    List<ParamTree> listParams(@Param("interfaceType") String interfaceType,
                               @Param("interfaceId") Long interfaceId,
                               @Param("paramType") String paramType);

    List<FieldInfo> selectFieldList(@Param("interfaceParamsFieldRelation") InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    List<FieldInfo> selectParamsList(@Param("interfaceParamsFieldRelation") InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    List<FieldInfo> selectParamsFieldList(@Param("id")Long id);

    List<FieldInfo> selectDubboFieldList(@Param("interfaceParamsFieldRelation")InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    List<FieldInfo> selectDubboParamsList(@Param("interfaceParamsFieldRelation") InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    int deleteInterfaceParamsFieldRelationByDataRelationId(@Param("ids") List<Long> ids);

    List<InterfaceParamsFieldRelation> selectInterfaceParamsFieldRelationByDataRelationId(@Param("dataRelationIds")List<Long> dataRelationIds, @Param("dataRelationType") String dataRelationType);

    List<FieldStatus> selectFieldStatusList(@Param("id") Long id);

    List<FieldStatus> selectFieldStatusListByParamsFieldId(@Param("id") Long id);

    List<InterfaceParamsFieldRelation> selectTableIdAndInterfaceIdById(@Param("id") Long id);

    void removeInterfaceId(@Param("idList")List<Long> idList);

    List<InterfaceParamsFieldRelation> selectInterfaceParamsFieldRelationByVUids(@Param("vuIds") List<Long> vuIds);

    void batchSave(@Param("list") List<InterfaceParamsFieldRelation> interfaceParamsFieldRelationList);

    int getMaxSort(@Param("type") String type, @Param("interfaceId") Long interfaceId, @Param("isInParam") String isInParam);

    List<TableInfo> tableList(@Param("interfaceId") Long interfaceId, @Param("type") String type, @Param("isInParam") Long isInParam);

    void updateSort(@Param("interfaceParamsFieldRelationList") List<InterfaceParamsFieldRelation> interfaceParamsFieldRelationList);

    List<InterfaceParam> listInterfaceALlField(@Param("listInterfaceFieldParamReq") ListInterfaceFieldParamReq listInterfaceFieldParamReq);

    void updateFieldDesign(@Param("interfaceParamsFieldRelation") InterfaceParamsFieldRelation interfaceParamsFieldRelation,
                           @Param("ids") List<Long> ids);

    void updateInterfaceParamsFieldRelationByFieldId(@Param("interfaceParamsFieldRelation") InterfaceParamsFieldRelation interfaceParamsFieldRelation);

    List<InterfaceParam> listInterfaceALlParamField(@Param("listInterfaceFieldParamReq") ListInterfaceFieldParamReq listInterfaceFieldParamReq);

    List<ObjectParam> objectParamList(@Param("interfaceId") Long interfaceId,
                                              @Param("interfaceType") String interfaceType,
                                              @Param("isInParam") String isInParam,
                                              @Param("objectType") String objectType);

    List<InterfaceParam> fieldModelList();

    List<InterfaceParam> fieldModelListByOutParam();
}
